function buildArray(nums: number[]): number[] {
    return nums.map(v => nums[v]);
}
